import pandas as pd
# 创建数据框
import pandas as pd
data = {
    'apple': [1100, 1050, 1200],
    'huawei': [1250, 1300, 1328],
    'oppo': [800, 850, 750]
}

df = pd.DataFrame(data, index=['一月', '二月', '三月'])

df
df.columns
df.loc['一月']
df.loc['一月', 'apple']
df3 = pd.DataFrame({'apple':{'一月':1100, '二月':1050, '三月':1200},
                    'huawei':{'一月':1250, '二月':1300, '三月':1328},
                    'oppo':{'一月':800, '二月':850, '三月':750}})
df.info()
df3['apple']
df3[['apple','oppo']]
df3.head(2)
df.tail(2)